home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / struct.h,v < prev    next >
Encoding:
Text File  |  1991-11-05  |  1.2 KB  |  54 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     91.11.05.15.44.02;  author rab;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @/*
  26.  * struct.h --
  27.  *
  28.  *    Declarations of macros for getting infomation about the fields
  29.  *      in a structure.
  30.  *
  31.  * Copyright 1991 Regents of the University of California
  32.  * Permission to use, copy, modify, and distribute this
  33.  * software and its documentation for any purpose and without
  34.  * fee is hereby granted, provided that this copyright
  35.  * notice appears in all copies.  The University of California
  36.  * makes no representations about the suitability of this
  37.  * software for any purpose.  It is provided "as is" without
  38.  * express or implied warranty.
  39.  *
  40.  * $Header: /sprite/lib/forms/RCS/proto.h,v 1.7 91/02/09 13:24:52 ouster Exp $ SPRITE (Berkeley)
  41.  */
  42.  
  43. #ifndef _STRUCT_H
  44. #define _STRUCT_H
  45.  
  46. #define fldoff(str, fld)        ((int)&(((struct str *)0)->fld))
  47. #define fldsiz(str, fld)        (sizeof(((struct str *)0)->fld))
  48. #define strbase(str, ptr, fld) \
  49.                             ((struct str *)((char *)(ptr)-fldoff(str, fld)))
  50.  
  51. #endif /* _STRUCT_H */
  52.  
  53. @
  54.